class CommentController < ApplicationController
  scaffold :comment
  before_filter :login_required, :only => [ :destroy, :create, :update, :edit, :new ]
  def create
   @comment = Comment.new(params[:comment])
   @comment.user=current_user
   if @comment.save
     flash[:notice] = "Comment was successfully created for #{ current_user.login }"
     redirect_to :controller => :doc, :action=> :show, :id=>@comment.commentable_id
   else
     render_scaffold('new')
   end
  end
end
